# coding=utf-8
import random
import json

contents = [
    '火钳刘明',
    '音容宛在，笑貌永存',
    '女王已出，前来还愿',
    '??????'
]

types = [
    'top',
    'normal',
    'normal'
]

colors = [
    '#FFFF00',
    '#FFFFFF',
    '#FFFFFF',
    '#FFFFFF',
    '#FFFFFF',
    '#FF3300',
    '#FF3300',
    '#FF3300',
    '#3399FF'
]

velocities = [
    0.1,
    0.2,
    0.3
]

if __name__ == "__main__":
    generation = []
    for i in range(3445):
        newBullet = {
            'id':i,
            'type': random.choice(types),
            'time': random.random() * 121,
            'content': random.choice(contents),
            'color': random.choice(colors)
        }
        if newBullet['type'] == 'normal':
            newBullet['velocity'] = random.choice(velocities)
        generation.append(newBullet)
    with open('media/bullet.json', 'w') as o:
        o.write(json.dumps(generation, ensure_ascii=False))